let {merge} = require('webpack-merge')
let base = require('./webpack.base.js')
const TerserPlugin = require('terser-webpack-plugin');
module.exports = merge(base,{
  mode:'production',
  optimization:{
    minimizer:[
      new TerserPlugin()
    ],
    splitChunks:{
      // 可以 把三方单独打包出去
      cacheGroups:{
        jq:{
          name:'jq',
          test:/jquery|lodash/,
          chunks:'initial'
        },
        // la:{
        //   name:'la',
        //   test:/lodash/,
        //   chunks:'initial'
        // }
      }
    }
  }
})